package com.sheng.user.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.sheng.model.OrderModel;
import com.sheng.service.OrderService;

/**
 * 订单控制类
 * @author chs
 * 
 */
@RestController
public class OrderController {
	
	@Reference 
	private OrderService orderService;

/**
 * 创建订单
 * @param order
 */
	@RequestMapping("/order/add")
	public void add(){
		System.out.println("接收前端请求");
		this.orderService.createOrder();
	}
/**	
 * 删除订单
 * @param orderId
 */
	@RequestMapping("/order/{orderId}/delete")
	public void delete(@PathVariable Integer orderId) {
		System.out.println("删除成功");
		orderService.removeOrder(orderId);
	}
}

